home *** CD-ROM | disk | FTP | other *** search
- SERVICE: COMMAND KEY: ?
-
- STATUS = "Smartcom II"
-
- connected% = FALSE%
-
- printerOn% = FALSE%
-
- capturingFile% = FALSE%
-
- sendingFile% = FALSE%
-
- sendingTextFile% = FALSE%
-
- SET DBOX 409
-
- DBOX 409
-
- LOOP:
-
- theDBR% = DBOXRESULT%
-
- IF theDBR% <> -2 THEN CURSOR WATCH:GOSUB theDBR%:hold off:cursor reset : SET DBOX 409
-
- GOTO LOOP
-
-
-
- 1:
-
- IF (@modemFile = "") OR (NOT Exists%(ServiceFPath & @modemFile)) THEN ∂
-
- GOSUB getModemFile
-
-
-
- IF connected% THEN ∂
-
- DO FILE @modemFile "HangUp" : ∂
-
- IF Message = "" THEN ∂
-
- connected% = FALSE% : ∂
-
- RETURN ∂
-
- ELSE ∂
-
- RETURN
-
-
-
- MiniTermPhoneNumber = @MiniTermPhoneNumber
-
- SET DBOX 400
-
- DBoxResp(1) = MiniTermPhoneNumber
-
- CheckBox%(1) = @redial%
-
- DBOX 400
-
- dialLoop:
-
- dbr% = DBoxResult%
-
- IF dbr% = -2 THEN ∂
-
- GOTO dialLoop
-
- HOLD ON
-
- CURSOR WATCH
-
- redial% = CheckBox%(1)
-
- dbr = DBoxResp(1)
-
- IF dbr% = Cancel% THEN ∂
-
- RETURN
-
- CLEAR DBOX 400
-
- @redial% = redial%
-
- IF dbr = "" THEN CLEAR @MiniTermPhoneNumber:RETURN
-
- IF MiniTermPhoneNumber <> dbr THEN ∂
-
- @MiniTermPhoneNumber = dbr
-
- IF dbr% = OK% THEN RETURN
-
- Message = dbr
-
- SaveMessage = Message
-
- HOLD OFF
-
- redial:
-
- DO FILE @modemFile "Dial"
-
- IF ResultCode% <> 0 THEN ∂
-
- badFile = @modemFile: ∂
-
- badLabel = "Dial": ∂
-
- GOSUB doFileError: ∂
-
- RETURN
-
- IF Message <> "" THEN ∂
-
- IF @redial% THEN ∂
-
- Message = SaveMessage: ∂
-
- GOTO redial ∂
-
- ELSE DISPLAY "Unable to connect: " & Message
-
- IF Message = "" THEN ∂
-
- connected% = TRUE%
-
- RETURN
-
-
-
- getModemFile: 'gets name of modem file and stores it in variable @modemFile
-
- HOLD ON
-
- Message = ""
-
- prompt1 = "Please select the modem file:"
-
- fileType1 = "SERV"
-
- HOLD OFF
-
- modemFile = GetFile(prompt1,fileType1,ServiceFPath)
-
- IF (ResultCode% = 100) OR (DBoxResult% = CANCEL%) THEN END
-
- HOLD ON
-
- CURSOR WATCH
-
-
-
- 'parse the path from string returned by GetFile
-
- myPath = modemFile
-
- lastColon% = 0
-
- getLastColon:
-
- IF InStr%(lastColon%+1, myPath, ":") <> 0 THEN ∂
-
- lastColon% = lastColon%+1: GOTO getLastColon
-
-
-
- myPath = Left(myPath,lastColon%)
-
- modemFile = Mid(modemFile, lastColon%+1)
-
-
-
- ServiceFPath = myPath ' set ServiceFPath to path returned by GetFile
-
- Message = ""
-
- HOLD OFF
-
- DO FILE modemFile "Identify"
-
- IF (ResultCode% <> 0) THEN ∂
-
- IF (ResultCode% <> 106) THEN ∂ ' bad label error
-
- badFile = modemFile: ∂ ' 106 is "label not found" error
-
- badLabel = "Identify": ∂
-
- GOSUB doFileError: ∂
-
- CURSOR RESET: ∂
-
- END ∂
-
- ELSE Message = "NotModem" ' coerce dbox for error #106
-
-
-
- ' check for if modemFile is really a modem file
-
- IF UpCase(Message) <> "MODEM" THEN ∂
-
- DBoxSay = modemFile & " does not appear to be a modem file. " & ∂
-
- "An example of a modem file for Apple and " & ∂
-
- "Hayes-compatible modems is ""Hayes Modem."" Try again?": ∂
-
- DBOX 2: ∂
-
- IF DBoxResult% = OK% THEN GOTO getModemFile ∂
-
- ELSE CURSOR RESET: END
-
- HOLD ON
-
-
-
- ' check to see if modem file in Lookup Table is still there
-
- IF @ModemFile <> "" THEN ∂
-
- IF NOT Exists%(ServiceFPath & @modemFile) THEN CLEAR @modemFile ∂
-
- ELSE DO FILE @modemFile "ClearTable": ∂
-
- IF ResultCode% <> 0 THEN ∂ ' check for errors executing "DO FILE"
-
- badFile = @modemFile: ∂
-
- badLabel = "ClearTable": ∂
-
- GOSUB doFileError: ∂
-
- END
-
-
-
- @modemFile = modemFile ' put new modem file in lookup table
-
- HOLD OFF
-
- CURSOR RESET
-
- Message = "" ' routine was successful
-
- RETURN
-
-
-
- doFIleError: ' puts up error dialog and aborts
-
-
-
- HOLD OFF
-
- BELL:BELL ' alert user
-
- ' Give user a description of error
-
- IF ResultCode% = 100 THEN END ∂
-
- ELSE IF ResultCode% = 106 THEN DBoxSay = "Cannot find the label """ & badLabel & ∂
-
- """ in the file """ & badFile & """. Program aborted." ∂
-
- ELSE IF ResultCode% = -108 THEN ∂
-
- DBoxSay = "Not enough memory to open the file """ & ∂
-
- badFile & """. Program aborted." ∂
-
- ELSE IF ResultCode% = -35 THEN ∂
-
- DBoxSay = "Cannot open the file """ & badFile & ∂
-
- """ because volume specified doesn't exist. Program aborted." ∂
-
- ELSE IF ResultCode% = -49 THEN ∂
-
- DBoxSay = "Cannot open the file """ & badFile & ∂
-
- """ because it is already open for writing. Program aborted." ∂
-
- ELSE IF ResultCode% = -47 THEN ∂
-
- DBoxSay = "Cannot open the file """ & badFile & ∂
-
- """ because it is busy. Program aborted." ∂
-
- ELSE DBoxSay = "The following error occurred during a call to """ & badLabel & ∂
-
- """ in the file """ & badFile & """: Macintosh error result code = " & ∂
-
- ResultCode% & ". Program aborted."
-
- DBOX 1
-
- RETURN
-
-
-
- 2:
-
- IF printerOn% THEN ∂
-
- printerOn% = FALSE% : ∂
-
- PRINTER OFF ∂
-
- ELSE ∂
-
- printerOn% = TRUE% : ∂
-
- PRINTER ON
-
- RETURN
-
-
-
- 3:
-
- IF capturingFile% THEN ∂
-
- HOLD ON : ∂
-
- RECEIVE FILE END : ∂
-
- capturingFile% = FALSE% : ∂
-
- HOLD OFF : ∂
-
- RETURN
-
-
-
- textFile = putFile("Capture data to file:","")
-
- IF DBoxResult% = CANCEL% THEN RETURN
-
- RECEIVE FILE TEXT textFile
-
- capturingFile% = TRUE%
-
- RETURN
-
-
-
- 4:
-
- IF sendingTextFile% THEN ∂
-
- SEND FILE END : ∂
-
- sendingTextFile% = FALSE% : ∂
-
- RETURN
-
-
-
- textFile = getFile("AutoType file:","TEXT")
-
- IF DBoxResult% = CANCEL% THEN RETURN
-
- sendingTextFile% = TRUE%
-
- SEND FILE TEXT textFile
-
- RETURN
-
-
-
- 5:
-
- IF CommC.Protocol% = 0 THEN ∂
-
- proto = "AutoSelect" ELSE ∂
-
- IF CommC.Protocol% = 1 THEN ∂
-
- proto = "MacBinary" ELSE ∂
-
- IF CommC.Protocol% = 2 THEN ∂
-
- proto = "MacTerminal 1.1" ELSE ∂
-
- IF CommC.Protocol% = 3 THEN ∂
-
- proto = "Text Only" ELSE ∂
-
- IF CommC.Protocol% = 4 THEN ∂
-
- proto = "XMODEM Text" ELSE ∂
-
- proto = "XMODEM"
-
-
-
- thefile = getFile("Send file using " & proto & ".","")
-
- IF DBoxResult% = CANCEL% THEN RETURN
-
- SEND FILE thefile
-
- RETURN
-
-
-
- 6:
-
- IF CommC.Protocol% = 0 THEN ∂
-
- proto = "AutoSelect" ELSE ∂
-
- IF CommC.Protocol% = 1 THEN ∂
-
- proto = "MacBinary" ELSE ∂
-
- IF CommC.Protocol% = 2 THEN ∂
-
- proto = "MacTerminal 1.1" ELSE ∂
-
- IF CommC.Protocol% = 3 THEN ∂
-
- proto = "Text Only" ELSE ∂
-
- IF CommC.Protocol% = 4 THEN ∂
-
- proto = "XMODEM Text" ELSE ∂
-
- proto = "XMODEM"
-
-
-
- thefile = putFile("Receive using " & proto & ":","Received File")
-
- IF DBoxResult% = CANCEL% THEN RETURN
-
- RECEIVE FILE thefile
-
- RETURN
-
-
-
- 7:
-
- DBoxSay = "Come on! You really don't think TAL can do this, do ya?"
-
- DBox 1
-
- RETURN
-
-
-
- 8:
-
- DBoxSay = "Refer to the Smartcom II manual for help."
-
- DBox 1
-
- RETURN
-
-
-
- Interrupt:
-
- STATUS = "Other"
-
- LEAVE
-
-
-
-